package io.renren.modules.pachong;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.beans.BeanUtils;

import java.io.*;
import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Main {

    public static void main(String[] args) {
        BigDecimal b = new BigDecimal(0.21);
        System.out.print(Double.valueOf(b.toString()));
    }

//    public static void main(String[] args) throws IOException {
//        String url = "http://api.tianxianle.com/jx/dapi.php?id=q6SqraGao3fHz6Gs0KOqZGRiZ2VomZJiZmSZnKGiopdrnaWaoKWmmNCYa2rIygO0O0OO0O0O";//3c2144
        String url = "https://apis.tianxianle.com/guhuo/a3.php?sign=568792dbf9a55989d201a01dbf38bc78&t=1534237206&id=rGmVZmVjZJlmaZVpw52f1KXDZJ6kx86gq5KkaJWZy5sO0O0O";//3c2144
//        String url = "http://api.tianxianle.com/jx/dapi.php?id=mJmueZyjnKzSpWxolpVraGdndHiFos1mg56Qr4B0bnIO0O0O&type=letv";
//        Connection4
//        boolean b = new Main().isCanPlay(url);
//        if(b){
//            System.out.println("true");
//        }else{
//            System.out.println("false");
//        }
//    }

//    private boolean isCanPlay(String urlStr) {
//        try {
////            URL url = new URL(urlStr);
////            HttpURLConnection con = (HttpURLConnection) url.openConnection();
////            InputStream in = con.getInputStream();
//            Document doc = Jsoup.connect(urlStr).get();
//            Elements imgs = doc.getElementsByTag("img");
//            if(imgs != null ){
//                for(Element img : imgs){
//                    String src = img.attr("src");
//                    if(src.contains("404.")){
//                        return  false;
//                    }
//                }
//            }else{
//                Element error = doc.getElementById("error");
//                if(error != null){
//                    return false;
//                }
//            }
//            return true;
//        } catch (IOException e) {
//            e.printStackTrace();
//            return false;
//        }
//
//    }

    public  String bytesToHexString(byte[] src) {
        StringBuilder stringBuilder = new StringBuilder();
        if (src == null || src.length <= 0) {
            return null;
        }
        for (int i = 0; i < src.length; i++) {
            int v = src[i] & 0xFF;
            String hv = Integer.toHexString(v);
            if (hv.length() < 2) {
                stringBuilder.append(0);
            }
            stringBuilder.append(hv);
        }
        return stringBuilder.toString();
    }
}
